// pages/calc/calc.js
Page({
  data: {
    numbers: 0
  },
  changeNumbers: function (event) {
    let num = this.data.numbers
    let a = Number(event.currentTarget.dataset.num);
    if (a > 0) {
      num++
      this.setData({
        numbers: num
      })
    } else {
      if (num <= 0) {
        wx.showToast({
          title: '不能小于0',
          icon: 'error'
        })
        return
      }
      num--
      this.setData({
        numbers: num
      })
    }
  }
})